//
//  MyVerticalButton.m
//  MyMiss
//
//  Created by Mac on 16/3/5.
//  Copyright © 2016年 Mac. All rights reserved.
//

#import "YJVerticalButton.h"

@implementation YJVerticalButton
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self setup];
    }
    return self;
}

-(void)awakeFromNib
{
    [self setup];
}

-(void)setup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    NSInteger inset = 12;
    //imagae
    self.imageView.width = 3.7 * GRIDW;
    self.imageView.height = self.imageView.width;
    self.imageView.x = (self.width - self.imageView.width)/2;
    self.imageView.y = inset;
    
    //titleLabel
    self.titleLabel.x = 0;
    self.titleLabel.y = self.imageView.height + inset;
    self.titleLabel.width = self.width;
    self.titleLabel.height = self.height - self.imageView.height - inset;

}


@end
